package xgame.chat;

import java.util.HashMap;
import java.util.Map;

import xgame.IXglobalHandler;
import xgame.IXmoduleT;
import xgame.XcommandXhandlerPair;
import xgame.chat.cmd.CmdIdConsts;
import xgame.chat.cmd.EntryCmd;
import xgame.chat.cmd.MessageCmd;
import xgame.chat.handler.EntryHandler;
import xgame.chat.handler.MessageHandler;

/**
 * 登录模块模板
 * 
 * @author AfritXia 
 * @version $Rev: 0 $
 *
 */
public class ChatModuleT implements IXmoduleT {
	@Override
	public Map<Integer, XcommandXhandlerPair> getCommandHandlerMap() {
		// 命令处理器字典
		Map<Integer, XcommandXhandlerPair> map = new HashMap<Integer, XcommandXhandlerPair>();

		// 添加进入聊天室命令
		map.put(CmdIdConsts.ENTRY_CMD, 
			XcommandXhandlerPair.newInstance(new EntryCmd(), new EntryHandler()));
		// 添加聊天命令
		map.put(CmdIdConsts.MESSAGE_CMD, 
			XcommandXhandlerPair.newInstance(new MessageCmd(), new MessageHandler()));
		
		return map;
	}

	@Override
	public IXglobalHandler getGlobalHandler() {
		return null;
	}
}
